<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8" />
  <title>编辑图书</title>
  <link href="https://cdn.staticfile.org/twitter-bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet" />
</head>
<body>
<div class="container mt-5">
  <h2>编辑图书</h2>
  <form th:action="@{/books/edit}" method="post">
    <input type="hidden" name="id" th:value="${book.id}" />
    <div class="mb-3">
      <label>书名</label>
      <input type="text" name="title" class="form-control" th:value="${book.title}" required />
    </div>
    <div class="mb-3">
      <label>作者</label>
      <input type="text" name="author" class="form-control" th:value="${book.author}" />
    </div>
    <div class="mb-3">
      <label>ISBN</label>
      <input type="text" name="isbn" class="form-control" th:value="${book.isbn}" />
    </div>
    <div class="mb-3">
      <label>库存</label>
      <input type="number" name="stock" class="form-control" th:value="${book.stock}" required />
    </div>
    <button type="submit" class="btn btn-primary">保存</button>
    <a href="/books" class="btn btn-secondary">取消</a>
  </form>
</div>
</body>
</html>
